package com.example.tao.mycar.utils;

import android.content.Context;
import android.content.SharedPreferences;
import android.view.View;

/**
 * Created by Tao on 2016/3/16.
 */
public class RequestUtils {

    private Context mContext;
    public static final String sharedpreference = "com.example.tao.mycar.register";
    public static String USERNAME = "username";
    public static String BABYNAME = "babyname";
    public static String BABYSEX = "babysex";
    public static String BABYBIRTHDAY = "babybirthday";
    public static String HEADIMAG = "imgurl";

    public static String BABYWEIGHT = "babyweight";
    public static String BABYHEIGHT = "babyheight";
    public static String MILEAGE = "mileage";

    public static UserHeightChangeListener mUserHeightChangeListener;
    public static UserWeightChangeListener mUserWeightChangeListener;

    public RequestUtils(Context context) {
        mContext = context;
    }

    public static SharedPreferences.Editor getSharedPreferenceEditor(Context context) {
        SharedPreferences sharedPreferences = context.getSharedPreferences(sharedpreference, Context.MODE_PRIVATE);
        return sharedPreferences.edit();
    }

    public static SharedPreferences getSharedPreference(Context context) {
        SharedPreferences sharedPreferences = context.getSharedPreferences(sharedpreference, Context.MODE_PRIVATE);
        return sharedPreferences;
    }


    public interface UserHeightChangeListener {
        void userHeightChange();
    }

    public void setUserHeightChangeListener(UserHeightChangeListener userHeightChangeListener) {
        mUserHeightChangeListener = userHeightChangeListener;
    }

    public interface UserWeightChangeListener {
        void userWeightChange();
    }

    public void setUserWeightChangeListener(UserWeightChangeListener userWeightChangeListener) {
        mUserWeightChangeListener = userWeightChangeListener;
    }

    public interface MyItemClickListener {
        void onItemClick(View view, int position);
    }

}
